package weibo

import org.apache.spark.SparkContext

object EveryMonthSend {
  def main(args: Array[String]): Unit = {
    val sc:SparkContext = new SparkContext("local[*]","EveryMonthSend")
    val inputPath:String = "file/WeiBoData/input"
    val outputPath:String = "file/WeiBoData/output/EveryMonthSend"

    val dataRdd = sc.textFile(inputPath)
      .map(x => {
        (x.split("\t")(2).substring(5,7),1)
      })
      .reduceByKey(_ + _)
      .sortBy(_._1)
      .repartition(2)

    dataRdd.foreach(println)

    sc.stop()

  }
}
